home *** CD-ROM | disk | FTP | other *** search
/ CD Actual 1 / PC Actual CD 01.iso / share / dos / graficos / plydat14.arj / SECTORL.PI < prev    next >
Encoding:
Text File  |  1992-04-05  |  1.0 KB  |  49 lines

  1. // Set up the camera
  2. viewpoint {
  3.    from <0,2,-5>
  4.    at <0,0,0>
  5.    up <0,1,0>
  6.    angle 30
  7.    resolution 160, 160
  8.    }
  9.  
  10. // Set up background color & lights
  11. background SkyBlue
  12. light <10, 20, -30>
  13.  
  14. // Define the color of the sphere
  15. define shiny_red
  16. texture {
  17.    surface {
  18.       ambient red, 0.2
  19.       diffuse red, 0.6
  20.       specular white, 0.8
  21.       microfacet Reitz 10
  22.       }
  23.    }
  24.  
  25.  
  26. define two_sphere object { sphere <0,0,0>, 2 }
  27.  
  28. // Conversion from polar to rectangular (for a left-handed
  29. // coordinate system):
  30. //
  31. //  r     = sqrt(x^2 + y^2 + z^2),
  32. //  theta = atan(y/x),
  33. //  phi   = atan(sqrt(x^2 + y^2)/z)
  34. //
  35. // Surface is:
  36. //   r = 1 + c * LegendreP(3,0,cos(phi))*cos(n*theta)
  37. //   r = 1 + c * 2.5 * cos(phi)^3 - 1.5 * cos(phi)
  38. // For this surface, use c = 0.2
  39.  
  40. // Define a zonal harmonic surface
  41. define theta atan(y/x)
  42. define phi atan(sqrt(x^2 + z^2)/y)
  43. define r sqrt(x^2 + y^2 + z^2)
  44. object {
  45.    function r - (1 + (0.5 * cos(phi)^3 - 0.3 * cos(phi)) * cos(3 * theta))
  46.    shiny_red
  47.    bounds two_sphere
  48.    }
  49.